package com.yanqu.road.entity.activity.sonhai.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.activity.sonhai.enums.SonHaiRewardFlagEnum;

@FieldTypeAnnotation(tableName = "t_c_activity_son_hai_user_egg_reward_data")
public class SonHaiUserEggRewardData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "分组ID", select = true, update = true)
    private int groupId;

    @FieldTypeAnnotation(desc = "玩家ID", select = true, update = true)
    private long userId;

    @FieldTypeAnnotation(desc = "唯一ID（相对活动）")
    private int id;

    @FieldTypeAnnotation(desc = "蛋ID")
    private int eggId;

    @FieldTypeAnnotation(desc = "奖励")
    private String reward;

    @FieldTypeAnnotation(desc = "领取状态 0未领取 1已领取")
    private int rewardFlag;

    @FieldTypeAnnotation(desc = "奖励领取时间")
    private long rewardTime;

    //创建时间
    @FieldTypeAnnotation(desc = "创建时间")
    private long createTime;

    public SonHaiUserEggRewardData() {
    }

    public SonHaiUserEggRewardData(int id, int activityId, int groupId, long userId, int eggId, String reward) {
        this.id = id;
        this.activityId = activityId;
        this.groupId = groupId;
        this.userId = userId;
        this.eggId = eggId;
        this.reward = reward;
        this.rewardFlag = SonHaiRewardFlagEnum.GET_NOT.getType();
        this.rewardTime = 0;
        this.createTime = System.currentTimeMillis();
        setInsertOption();
    }

    public int getActivityId() {
        return activityId;
    }
    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        if (this.groupId != groupId) {
            this.groupId = groupId;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }
    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public int getId() {
        return id;
    }
    public void setId(int id) {
        if (this.id != id) {
            this.id = id;
            setOp(DataStatus.Update);
        }
    }

    public int getEggId() {
        return eggId;
    }
    public void setEggId(int eggId) {
        if (this.eggId != eggId) {
            this.eggId = eggId;
            setOp(DataStatus.Update);
        }
    }

    public String getReward() {
        return reward;
    }
    public void setReward(String reward) {
        if (reward == null){
            return;
        }
        if (this.reward == null || !this.reward.equals(reward)) {
            this.reward = reward;
            setOp(DataStatus.Update);
        }
    }

    public int getRewardFlag() {
        return rewardFlag;
    }
    public void setRewardFlag(int rewardFlag) {
        if (this.rewardFlag != rewardFlag) {
            this.rewardFlag = rewardFlag;
            setOp(DataStatus.Update);
        }
    }

    public long getRewardTime() {
        return rewardTime;
    }
    public void setRewardTime(long rewardTime) {
        if (this.rewardTime != rewardTime) {
            this.rewardTime = rewardTime;
            setOp(DataStatus.Update);
        }
    }

    public long getCreateTime() {
        return createTime;
    }
    public void setCreateTime(long createTime) {
        if (this.createTime != createTime) {
            this.createTime = createTime;
            setOp(DataStatus.Update);
        }
    }
}
